package com.juzipi.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.juzipi.demo.mapper.ResourceMapper;
import com.juzipi.demo.pojo.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ResourceService {


    @Autowired
    private ResourceMapper resourceMapper;


    public Resource queryResourceByUri(String requestURI) {

        return resourceMapper.selectOne(new QueryWrapper<Resource>().lambda().eq(Resource::getUrl, requestURI));
    }
}
